home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1998 July / EnigmA AMIGA RUN 29 (1998)(G.R. Edizioni)(IT)[!][issue 1998-07 & 08].iso / earkit / browser / alynx / goodies / mail.rexx < prev    next >
OS/2 REXX Batch file  |  1998-05-24  |  3KB  |  89 lines

  1. /*) SimpleSendMail v1.0 by Josef Faulkner (panther@gate.net) IRC: Josef
  2. \\\
  3. /// Custom version written for Alynx
  4. \\\
  5. /// Installation: Simple 1,2,3
  6. \\\ 
  7. /// 1) Install TCP: by mounting TCP: (mlink) or just run AmiTCP
  8. \\\ 2) Set your SMTP hostname below (your server's hostname)
  9. /// 3) Copy this script to C: and protect c:mail +S
  10. \\\ 
  11. /// This arexx script will not workw ith As225.  If you are using mlink,
  12. \\\ then mount tcp: from amitcp:devs/inet-mountlist.  If you need the
  13. /// mountlist entry and handler, mail me and I will send it to you uuencoded.
  14. \\\
  15. (*/
  16.  
  17. SMTPHost   = 'cyber.gate.net'   /* Your ISP's mail server, or leave as
  18.                                    cyber.gate.net as I know it works. */
  19.  
  20. /*) How it works:
  21. \\\ Sending mail is no problem for SLIP, however the problem with most mail
  22. /// clients is the reading.  This solves the problem for those of us who dont
  23. \\\ need to read mail while on SLIP, and only want to send it.
  24. ///
  25. \\\ This program connects to port 25 (SMTP) of your unix host, tells it
  26. /// who you are, and who you want your mail to go to, then it sends the message
  27. \\\ data and quits.  Pretty simple, eh?
  28. ///
  29. \\\ If you have any questions, comments, or whatever, mail me (panther@gate.net)
  30. ///
  31. \\\ Disclaimer:
  32. /// This program is public domain, use at your own risk, if something goes
  33. \\\ wrong, feel free to drop me a message or if you have any questions.
  34. /// However, if you dont like this program, then dont use it, you didnt pay
  35. \\\ anything for it, so dont flame me because it doesnt work on your system...
  36. (*/
  37.  
  38. options results
  39. if ~show('L','rexxsupport.library') then if ~addlib('rexxsupport.library',0,-30,0) then do
  40.     'echo You need rexxsupport.library version 30 or greater in libs:'
  41.     exit 10 
  42. end
  43. parse arg file
  44. file=strip(file)
  45. if ~showlist(H,'TCP') then address command 'mount TCP: from amitcp:devs/inet-mountlist'
  46. if ~showlist(H,'TCP') then address command 'mount TCP:'
  47. if showlist(H,'TCP') then do
  48.     if file~='' then do
  49.         call open(1,file,r)
  50.         do until eof(1)
  51.             text=readln(1)
  52.             if word(text,1)='Subject:' then do
  53.                 parse var text .' 'subj
  54.                 subj=strip(subj)
  55.             end
  56.             if word(text,1)='To:' then do
  57.                 userid=strip(word(text,2))
  58.             end
  59.             if word(text,1)='From:' then do
  60.                 myemailaddr=strip(word(text,2))
  61.             end
  62.         end
  63.         call close(1)
  64.         if showlist('A','HOME') then do
  65.             if exists('HOME:.signature') then do
  66.                 address command 'type home:.signature >>'file
  67.             end
  68.         end
  69.         call open(1,'tcp:'smtphost'/25',w)
  70.         call writeln(1,'HELO')
  71.         call writeln(1,'MAIL FROM: '||myemailaddr)
  72.         call writeln(1,'RCPT TO: '||userid)
  73.         call writeln(1,'DATA')
  74.         call open(2,file,r)
  75.         do until eof(2)
  76.             text=readln(2)
  77.             call writeln(1,text)
  78.         end
  79.         call close(2)
  80.         call writeln(1,'.')
  81.         call writeln(1,'QUIT')
  82.         call close(1)
  83.         address command 'Requestchoice title="Simple MailSend" BODY="Mail Sent." GADGETS="Ok" >NIL:'
  84.     end
  85.     else address command 'Requestchoice title="Simple MailSend" BODY="Mail Send Aborted." GADGETS="Ok" >NIL:'
  86. end
  87. else address command 'Requestchoice title="Simple MailSend" BODY="Error:*eCould not find temp file." GADGETS="Ok" >NIL:'
  88. exit
  89.